<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInLeft">
        <div data-th-replace="common/functionDepict"></div>
        <div>
            <div class="row">
                <div class="pt10">
                    <div class="col-sm-9">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>填写基本信息</h5>
                            </div>
                            <div class="ibox-content clearfix pt10">
                                <form class="form-horizontal m-t" id="qaTypeForm">
                                    <div class="form-horizontal">
                                        <input name="id" th:value="${qaType['id']}" type="hidden"/>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 分类名称</label>
                                            <div class="col-sm-8">
                                                <input class="validate-data form-control" type="text" name="typeName" th:value="${qaType['typeName']}"/>
                                                <span class="help-block m-b-none c-999">分类名称 限30个字以内</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right">类别图标</label>
                                            <div class="col-sm-8">
                                                <p>
                                                    <button class="btn btn-primary " id="qaTypeImageBtn" type="button"><i class="fa fa-image"></i>&nbsp;选择类别图标</button>
                                                </p>
                                                <div class="clearfix">
                                                    <div class="file-box">
                                                        <div class="file">
                                                            <span class="corner" title="删除" id="remove-image"><i class="fa fa-remove"></i></span>
                                                            <div class="image">
                                                                <input type="hidden" id="imageJson" name="imageJson" th:value="${qaType['imageJson']}"/>
                                                                <img alt="类别图标" id="qaType-image" class="img-responsive" th:src="!${#maps.isEmpty(qaType['imageMap'])} ? ${qaType['imageMap']['pcUrlMap']['large']} : ''">
                                                            </div>
                                                            <div class="file-name">
                                                                <p id="file-names" th:text="!${#maps.isEmpty(qaType['imageMap'])} and ${qaType['imageMap']['fileName']}!=null ? ${qaType['imageMap']['fileName']}:'文件名'"></p>
                                                                <small id="create-time" th:text="!${#maps.isEmpty(qaType['imageMap'])} and ${qaType['imageMap']['createTime']}!=null ?'上传时间：' + ${qaType['imageMap']['createTime']}:'上传时间'"></small>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right">类别说明</label>
                                            <div class="col-sm-8">
                                                <textarea name="depict" class="form-control" style="height: 100px; resize: none;" th:text="${qaType['depict']}"></textarea>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <div class="col-sm-8 col-sm-offset-2">
                                                <button id="save-continue" class="btn btn-danger ml10" type="button">保存，继续创建</button>
                                                <button id="save-back" class="btn btn-primary ml10" type="button">保存，返回</button>
                                                <button id="cancel" class="btn btn-white ml10" type="button">取消</button>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div data-th-replace="common/importantNotes"></div>
                </div>
            </div>
        </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script type="text/javascript" th:src="@{{path}/admin/business/upload/common-webuploader.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/qa/qatype/save-qa-type.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>
</html>